﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using System.Data;
using Antu.WorkFlowFactory;

namespace WebSys.UI.SysManage
{
    public class dropdown : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Antu.WebControls.MPHeader.RegistAjaxScripts(typeof(dropdown));
            //CainBo.Master.Header.RegistAjaxScripts(typeof(dropdown));
            if (!IsPostBack)
            {
                
            }
        }
        [Antu.Core.Ajax.AjaxMethod()]
        public static string getRemark()
        {
            FlowFactoryProvider _FlowFactoryProvider1 = (FlowFactoryProvider)ProviderService.ProviderServiceMange.GetProvider("FlowFactoryProvider");
            StringBuilder sbr = new StringBuilder();
            string sql = "select * from zs_user where 1=1 ";
            DataTable dt = _FlowFactoryProvider1.GetDT(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (sbr.Length > 0) { sbr.Append(","); }
                    sbr.Append(dt.Rows[i]["name"].ToString());
                }
            }
            return sbr.ToString();
        }
        [Antu.Core.Ajax.AjaxMethod()]
        public static string getRemarks(string name)
        {
            FlowFactoryProvider _FlowFactoryProvider1 = (FlowFactoryProvider)ProviderService.ProviderServiceMange.GetProvider("FlowFactoryProvider");
            StringBuilder sbr = new StringBuilder();
            string sql = "select * from zs_user where 1=1 ";
            if (!string.IsNullOrEmpty(name))
            {
                sql += "and name like '%" + name.Trim() + "%'";
            }
            DataTable dt = _FlowFactoryProvider1.GetDT(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (sbr.Length > 0) { sbr.Append(","); }
                    sbr.Append(dt.Rows[i]["name"].ToString());
                }

            }
            return sbr.ToString();
        } 
    }
}


